﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace CamShared
{
    public class CamShared
    {
        public delegate void FrameReceived(ICamera cam, Image frame);
        public delegate void CameraError(ICamera cam, string Error, bool Fatal);
        public delegate void RaiseRame(ICamera cam, Image frame);

        public delegate void CameraDiscovered(ICamera cam, ICameraConnector conn);
    }

    public interface ICamera : IDisposable
    {
        event CamShared.FrameReceived OnFrame;
        event CamShared.CameraError OnError;

        string Name { get; }
        string UID { get; }
        string Class { get; }
        int FrameCount { get; }
        int Sessions { get; }
        void Activate();
        void Deactivate();
        bool Active { get; }
        List<string> Attributes { get; }
        bool ShowConfig(IntPtr handle);
    }

    public interface INetworkCSCamera
    {
        int Quality { get; set; }
        int Delay { get; set; }
    }

    public interface ICameraConnector : IDisposable
    {
         event CamShared.CameraDiscovered CameraDiscovered;
         void DetectCameras();
         ICamera CreateCamera(string Name, string Class, string[] args);
         string Name { get; }
    }

    public interface ICameraOutput : IDisposable
    {
         void FrameReceived(ICamera camera, Image frame);
         void ErrorOccured(ICamera camera, string Error, bool Fatal);
         void CameraAttached(ICamera camera);
         string Name { get; }
    }

    public interface ICameraFilter : IDisposable
    {
        Image FrameReceived(ICamera camera, Image frame);
        event CamShared.RaiseRame OnNewFrame;
        string Name { get; }
    }
}
